import request from './request'

export const getSignature = () => {
  return new Promise((resolve, reject) => {
    request.get(`/jsApi/getSignature`).then(response =>{
      resolve(response.data);
    }).catch(error=>{
      reject(error);
    });
  });
};

/*
export const getToken = params => {
  return new Promise((resolve, reject) => {
    server.get(`/token?grant_type=client_credential&appid=${params.appId}&secret=${params.secret}`).then(response =>{
      console.info(response="=====");
      resolve(response);
    }).catch(error=>{
      console.info(error+"======");
      reject(error);
    });
  });
};


export const getJsapiTicket = param => {
  return new Promise((resolve, reject) => {
    server.get(`/ticket/getticket?access_token=${param}&type=jsapi`).then(function (result) {
      resolve(result);
    }).catch(error=>{
      reject(error);
    });
  })
};
*/
